using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class PlayerFootAttack : MonoBehaviour
{
    public Trigger2D m_FootTrigger2D;

    public float m_JumpSpeed = 15f;

    public Rigidbody2D m_Rigidbody2D;

    public UnityEvent OnFootAttack;

    private void Awake()
    {
        m_FootTrigger2D.m_OnEnterTriggerWithCollider.AddListener((collider) => {
            OnFootAttack?.Invoke();
            collider.GetComponent<CharacterHit>().ExecuteHit();
            m_Rigidbody2D.velocity = new Vector2(m_Rigidbody2D.velocity.x,m_JumpSpeed);
        });
    }
}
